Field of the Invention
Embodiments of the present invention relate generally to graphics processing and, more specifically, to target-independent rasterization with multiple color samples.
Description of the Related Art
Path rendering is a graphics processing paradigm where a two-dimensional graphics scene is defined by a collection of “paths.” Each path is generally a mathematical description of a line, shape, or other geometric construct. Each such mathematical description may be resolved into pixels at an arbitrary resolution, and so the description of the scene to render is independent of the actual resolution of a target display device. For this reason, certain path rendering approaches may be referred to as “resolution-independent 2D graphics.”
A computer system configured to implement conventional path rendering typically relies on a central processing unit (CPU) to resolve a collection of paths into pixels. In doing so, the CPU generally implements a scan-line rasterization approach where path coverage may be assessed by an analytic approximation of coverage based what fraction of a pixel's extent intersects the path and one or more sub-pixel scan-lines. The CPU renders a pixel based on a path by performing two general steps: first, the CPU identifies a path's fractional coverage for each pixel fully or partially covered by the path. Second, the CPU shades the pixel based on the identified fractional coverage for each pixel. With this conventional approach, a given pixel is typically assigned a color value that is derived from any paths covering that sample. Thus, each pixel needs to maintain just a single cumulative color. The disadvantage of the CPU-based scan-line approach is the scan-line rasterization process requires sequential scanning of scan-lines, making it less parallel that GPU-based rasterization algorithms.
CPU-based path rendering has recently given way to graphics processing unit (GPU)-based path rendering. With GPU-based path rendering, the highly parallel architecture of modern GPUs is leveraged to accelerate conventional path rendering by parallelizing the coverage assessment and pixel shading steps discussed above through various techniques. However, the conventional path rendering approach discussed previously must be adapted for execution on GPUs due to certain differences in the multisampling technique performed by GPUs.
In particular, modern GPUs typically sample pixels at multiple locations (with 4 samples typical of much 3D rendering) to assess coverage to minimize edge antialiasing for polygonal 3D rendering. Path rendering demands increased antialiasing quality so the number of coverage samples must be increased to 8 or 16 in order to generate rendered images with a quality that is comparable to CPU-based approaches. However, the corresponding number of color samples typically cannot be increased to such a high number, because color samples are generally quite large compared to coverage samples and modern GPUs may lack the per-pixel memory storage and bandwidth to store and update 8 or 16 color samples per pixel. In the absence of a GPU-based approach with reasonable memory storage and bandwidth requirements for acceptable quality, systems for path rendering may simply forego the benefits of GPU-acceleration of path rendering.
Accordingly, what is needed in the art is an improved technique for GPU-based path rendering.